home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
011
/
attclk2.arc
/
READPORT.C
< prev
next >
Wrap
Text File
|
1986-01-09
|
563b
|
26 lines
/* :ts=8
*
* readport()
*
* Reads a byte from the specified real time clock
* port. Only the lower four bits are valid and a
* value of 0x0f indicates an update occured while
* reading the port.
*
*/
readport(portaddr)
int portaddr;
{
/* the following bit-field is used to */
/* auto-magically strip the upper 4 bits */
/* from the byte read from the port portaddr. */
struct {
unsigned value : 4;
} port;
while ((port.value = inportb(portaddr)) == 0x0f)
; /* loop until no error occurs */
return(port.value);
}